{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 注意！请根据提示操作！\n",
    "\n",
    "如果当页面加载完成，你还是看到了这条提示\n",
    "\n",
    "那么你的notebook并未被信任，导致代码无法正常运行\n",
    "\n",
    "点击右上角的`不可信`，将本notebook列入可信列表，即可正常运行。\n",
    "\n",
    "![可信按钮](./mgr/trust.png)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 【测试】合法变量名\n",
    "挑出可用的变量名，按顺序print出来\n",
    "\n",
    "a\n",
    "\n",
    "!!!\n",
    "\n",
    "abc\n",
    "\n",
    "ipt\n",
    "\n",
    "_abc\n",
    "\n",
    "1st\n",
    "\n",
    "_\n",
    "\n",
    "__\n",
    "\n",
    "if\n",
    "\n",
    "if_\n",
    "\n",
    "print_\n",
    "\n",
    "_print\n",
    "\n",
    "first name\n",
    "\n",
    "first_name\n",
    "\n",
    "请修改下面的代码，输出所有可用的变量名"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "print('a')\n",
    "print('abc')\n",
    "# 请在此处补充完整"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script src=\"./mgr/submit.js\"></script>\n",
       "<script src=\"./mgr/hide.js\"></script>\n",
       "<script>\n",
       "    $(document).ready(function(){\n",
       "        hide_input()\n",
       "    })\n",
       "    window.onload = function(){\n",
       "        hide_input()\n",
       "        if_login_btn_show()\n",
       "        requirejs.config({\n",
       "          paths: {\n",
       "              axios: \"//cdn.bootcss.com/axios/0.19.0-beta.1/axios.min\",\n",
       "              mdui: \"//cdn.bootcss.com/mdui/0.4.3/js/mdui.min\"\n",
       "          }\n",
       "        })\n",
       "    }\n",
       "</script>\n",
       "<link rel=\"stylesheet\" href=\"//cdn.bootcss.com/mdui/0.4.3/css/mdui.min.css\">\n",
       "<div class=\"mdui-container-fluid\">\n",
       "    <div class=\"mdui-col-xs-3\">\n",
       "        <button class=\"mdui-btn mdui-btn-raised mdui-ripple mdui-color-teal-500\" onclick=\"run_cell()\" style=\"display:none\">测试运行</button>\n",
       "        <button class=\"mdui-btn mdui-btn-raised mdui-ripple mdui-color-teal-700\" onclick=\"sub()\">提交</button>\n",
       "    </div>\n",
       "    <div class=\"mdui-col-xs-9\">\n",
       "        <p id=\"loading\" class=\"mdui-btn\">加载中，请稍后...（如长时间未加载完成请刷新页面）</p>\n",
       "        <button id=\"username_show\" class=\"mdui-btn\" style=\"display:none\"></button>\n",
       "        <button class=\"mdui-btn mdui-btn-raised mdui-ripple mdui-color-pink-400\" id=\"login_btn\" onclick=\"$('.login_ui').toggle();$('.reg_ui').hide()\" style=\"display:none\">登录</button>\n",
       "        <button class=\"mdui-btn mdui-btn-raised mdui-ripple mdui-color-pink-900\" id=\"reg_btn\" onclick=\"$('.reg_ui').toggle();$('.login_ui').hide()\" style=\"display:none\">注册</button>\n",
       "        <button class=\"mdui-btn mdui-btn-raised mdui-ripple mdui-color-teal-500\" id=\"manage_btn\" onclick=\"$('.change_pwd_ui').toggle()\" style=\"display:none\">修改密码</button>\n",
       "        <button class=\"mdui-btn mdui-btn-raised mdui-ripple mdui-color-teal-900\" id=\"logout_btn\" onclick=\"logout()\" style=\"display:none\">退出账号</button>\n",
       "    </div>\n",
       "</div>\n",
       "<div style=\"display:none\" class=\"mdui-container-fluid login_ui\">\n",
       "    <p>如没有账号请点击右侧注册</p>\n",
       "    <div class=\"mdui-col-md-4 mdui-col-sm-12\">\n",
       "      <input class=\"mdui-textfield-input\" type=\"text\" id=\"username\" placeholder=\"用户名\" required/>\n",
       "    </div>\n",
       "    <div class=\"mdui-col-md-4 mdui-col-sm-12\">\n",
       "      <input type=\"password\" class=\"mdui-textfield-input\" type=\"text\" id=\"pwd\" placeholder=\"密码\" required/>\n",
       "    </div>\n",
       "    <div class=\"mdui-col-md-4 mdui-col-sm-12\">\n",
       "        <button class=\"mdui-btn mdui-btn-raised mdui-ripple mdui-color-pink-600\" onclick=\"login()\">确定</button>\n",
       "    </div>\n",
       "</div>\n",
       "<div style=\"display:none\" class=\"mdui-container-fluid reg_ui\">\n",
       "    <p>请注册</p>\n",
       "    <div class=\"mdui-col-md-3 mdui-col-sm-12\">\n",
       "      <input class=\"mdui-textfield-input\" type=\"text\" id=\"reg_username\" placeholder=\"用户名\" required/>\n",
       "    </div>\n",
       "    <div class=\"mdui-col-md-3 mdui-col-sm-12\">\n",
       "      <input type=\"password\" class=\"mdui-textfield-input\" type=\"text\" id=\"reg_pwd\" placeholder=\"密码\" required/>\n",
       "    </div>\n",
       "    <div class=\"mdui-col-md-3 mdui-col-sm-12\">\n",
       "      <input type=\"password\" class=\"mdui-textfield-input\" type=\"text\" id=\"reg_chk_pwd\" placeholder=\"重复密码\" required/>\n",
       "    </div>\n",
       "    <div class=\"mdui-col-md-3 mdui-col-sm-12\">\n",
       "        <button class=\"mdui-btn mdui-btn-raised mdui-ripple mdui-color-pink-600\" onclick=\"reg()\">确定</button>\n",
       "    </div>\n",
       "</div>\n",
       "<div style=\"display:none\" class=\"mdui-container-fluid change_pwd_ui\">\n",
       "    <p>修改密码</p>\n",
       "    <div class=\"mdui-col-md-3 mdui-col-sm-12\">\n",
       "      <input type=\"password\" class=\"mdui-textfield-input\" id=\"old_pwd\" placeholder=\"旧密码\" required/>\n",
       "    </div>\n",
       "    <div class=\"mdui-col-md-3 mdui-col-sm-12\">\n",
       "      <input type=\"password\" class=\"mdui-textfield-input\" type=\"text\" id=\"new_pwd\" placeholder=\"新密码\" required/>\n",
       "    </div>\n",
       "    <div class=\"mdui-col-md-3 mdui-col-sm-12\">\n",
       "      <input type=\"password\" class=\"mdui-textfield-input\" type=\"text\" id=\"chk_new_pwd\" placeholder=\"重复新密码\" required/>\n",
       "    </div>\n",
       "    <div class=\"mdui-col-md-3 mdui-col-sm-12\">\n",
       "        <button class=\"mdui-btn mdui-btn-raised mdui-ripple mdui-color-pink-600\" onclick=\"change_pwd()\">确定</button>\n",
       "    </div>\n",
       "</div>\n",
       "<div id=\"html_output\">\n",
       "</div>\n"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%%html\n",
    "\n",
    "<script src=\"./mgr/submit.js\"></script>\n",
    "<script src=\"./mgr/hide.js\"></script>\n",
    "<script>\n",
    "    $(document).ready(function(){\n",
    "        hide_input()\n",
    "    })\n",
    "    window.onload = function(){\n",
    "        hide_input()\n",
    "        if_login_btn_show()\n",
    "        requirejs.config({\n",
    "          paths: {\n",
    "              axios: \"//cdn.bootcss.com/axios/0.19.0-beta.1/axios.min\",\n",
    "              mdui: \"//cdn.bootcss.com/mdui/0.4.3/js/mdui.min\"\n",
    "          }\n",
    "        })\n",
    "    }\n",
    "</script>\n",
    "<link rel=\"stylesheet\" href=\"//cdn.bootcss.com/mdui/0.4.3/css/mdui.min.css\">\n",
    "<div class=\"mdui-container-fluid\">\n",
    "    <div class=\"mdui-col-xs-3\">\n",
    "        <button class=\"mdui-btn mdui-btn-raised mdui-ripple mdui-color-teal-500\" onclick=\"run_cell()\" style=\"display:none\">测试运行</button>\n",
    "        <button class=\"mdui-btn mdui-btn-raised mdui-ripple mdui-color-teal-700\" onclick=\"sub()\">提交</button>\n",
    "    </div>\n",
    "    <div class=\"mdui-col-xs-9\">\n",
    "        <p id=\"loading\" class=\"mdui-btn\">加载中，请稍后...（如长时间未加载完成请刷新页面）</p>\n",
    "        <button id=\"username_show\" class=\"mdui-btn\" style=\"display:none\"></button>\n",
    "        <button class=\"mdui-btn mdui-btn-raised mdui-ripple mdui-color-pink-400\" id=\"login_btn\" onclick=\"$('.login_ui').toggle();$('.reg_ui').hide()\" style=\"display:none\">登录</button>\n",
    "        <button class=\"mdui-btn mdui-btn-raised mdui-ripple mdui-color-pink-900\" id=\"reg_btn\" onclick=\"$('.reg_ui').toggle();$('.login_ui').hide()\" style=\"display:none\">注册</button>\n",
    "        <button class=\"mdui-btn mdui-btn-raised mdui-ripple mdui-color-teal-500\" id=\"manage_btn\" onclick=\"$('.change_pwd_ui').toggle()\" style=\"display:none\">修改密码</button>\n",
    "        <button class=\"mdui-btn mdui-btn-raised mdui-ripple mdui-color-teal-900\" id=\"logout_btn\" onclick=\"logout()\" style=\"display:none\">退出账号</button>\n",
    "    </div>\n",
    "</div>\n",
    "<div style=\"display:none\" class=\"mdui-container-fluid login_ui\">\n",
    "    <p>如没有账号请点击右侧注册</p>\n",
    "    <div class=\"mdui-col-md-4 mdui-col-sm-12\">\n",
    "      <input class=\"mdui-textfield-input\" type=\"text\" id=\"username\" placeholder=\"用户名\" required/>\n",
    "    </div>\n",
    "    <div class=\"mdui-col-md-4 mdui-col-sm-12\">\n",
    "      <input type=\"password\" class=\"mdui-textfield-input\" type=\"text\" id=\"pwd\" placeholder=\"密码\" required/>\n",
    "    </div>\n",
    "    <div class=\"mdui-col-md-4 mdui-col-sm-12\">\n",
    "        <button class=\"mdui-btn mdui-btn-raised mdui-ripple mdui-color-pink-600\" onclick=\"login()\">确定</button>\n",
    "    </div>\n",
    "</div>\n",
    "<div style=\"display:none\" class=\"mdui-container-fluid reg_ui\">\n",
    "    <p>请注册</p>\n",
    "    <div class=\"mdui-col-md-3 mdui-col-sm-12\">\n",
    "      <input class=\"mdui-textfield-input\" type=\"text\" id=\"reg_username\" placeholder=\"用户名\" required/>\n",
    "    </div>\n",
    "    <div class=\"mdui-col-md-3 mdui-col-sm-12\">\n",
    "      <input type=\"password\" class=\"mdui-textfield-input\" type=\"text\" id=\"reg_pwd\" placeholder=\"密码\" required/>\n",
    "    </div>\n",
    "    <div class=\"mdui-col-md-3 mdui-col-sm-12\">\n",
    "      <input type=\"password\" class=\"mdui-textfield-input\" type=\"text\" id=\"reg_chk_pwd\" placeholder=\"重复密码\" required/>\n",
    "    </div>\n",
    "    <div class=\"mdui-col-md-3 mdui-col-sm-12\">\n",
    "        <button class=\"mdui-btn mdui-btn-raised mdui-ripple mdui-color-pink-600\" onclick=\"reg()\">确定</button>\n",
    "    </div>\n",
    "</div>\n",
    "<div style=\"display:none\" class=\"mdui-container-fluid change_pwd_ui\">\n",
    "    <p>修改密码</p>\n",
    "    <div class=\"mdui-col-md-3 mdui-col-sm-12\">\n",
    "      <input type=\"password\" class=\"mdui-textfield-input\" id=\"old_pwd\" placeholder=\"旧密码\" required/>\n",
    "    </div>\n",
    "    <div class=\"mdui-col-md-3 mdui-col-sm-12\">\n",
    "      <input type=\"password\" class=\"mdui-textfield-input\" type=\"text\" id=\"new_pwd\" placeholder=\"新密码\" required/>\n",
    "    </div>\n",
    "    <div class=\"mdui-col-md-3 mdui-col-sm-12\">\n",
    "      <input type=\"password\" class=\"mdui-textfield-input\" type=\"text\" id=\"chk_new_pwd\" placeholder=\"重复新密码\" required/>\n",
    "    </div>\n",
    "    <div class=\"mdui-col-md-3 mdui-col-sm-12\">\n",
    "        <button class=\"mdui-btn mdui-btn-raised mdui-ripple mdui-color-pink-600\" onclick=\"change_pwd()\">确定</button>\n",
    "    </div>\n",
    "</div>\n",
    "<div id=\"html_output\">\n",
    "</div>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<hr>\n",
       "<link rel=\"stylesheet\" href=\"//cdn.bootcss.com/mdui/0.4.3/css/mdui.min.css\">\n",
       "<script src=\"./mgr/submit.js\"></script>\n",
       "<script src=\"./mgr/hide.js\"></script>\n",
       "<div class=\"mdui-container-fluid\">\n",
       "    <div class=\"mdui-col-xs-3\">\n",
       "        <button class=\"mdui-btn mdui-btn-raised mdui-ripple mdui-color-blue-grey-500\" onclick=\"next_page(-1)\">上一章</button>\n",
       "    </div>\n",
       "    <div class=\"mdui-col-xs-3\">\n",
       "        <button class=\"mdui-btn mdui-btn-raised mdui-ripple mdui-color-blue-grey-700\" onclick=\"window.open('/tree')\">目录</button>\n",
       "    </div>\n",
       "    <div class=\"mdui-col-xs-3\">\n",
       "        <button class=\"mdui-btn mdui-btn-raised mdui-ripple mdui-color-blue-grey-900\" onclick=\"next_page(1)\">下一章</button>\n",
       "    </div>\n",
       "</div>\n",
       "<div id=\"html_output\">\n",
       "</div>\n"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%%html\n",
    "<hr>\n",
    "<link rel=\"stylesheet\" href=\"//cdn.bootcss.com/mdui/0.4.3/css/mdui.min.css\">\n",
    "<script src=\"./mgr/submit.js\"></script>\n",
    "<script src=\"./mgr/hide.js\"></script>\n",
    "<div class=\"mdui-container-fluid\">\n",
    "    <div class=\"mdui-col-xs-3\">\n",
    "        <button class=\"mdui-btn mdui-btn-raised mdui-ripple mdui-color-blue-grey-500\" onclick=\"next_page(-1)\">上一章</button>\n",
    "    </div>\n",
    "    <div class=\"mdui-col-xs-3\">\n",
    "        <button class=\"mdui-btn mdui-btn-raised mdui-ripple mdui-color-blue-grey-700\" onclick=\"window.open('/tree')\">目录</button>\n",
    "    </div>\n",
    "    <div class=\"mdui-col-xs-3\">\n",
    "        <button class=\"mdui-btn mdui-btn-raised mdui-ripple mdui-color-blue-grey-900\" onclick=\"next_page(1)\">下一章</button>\n",
    "    </div>\n",
    "</div>\n",
    "<div id=\"html_output\">\n",
    "</div>"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
